package com.wb.mas.storage;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import javax.annotation.Nullable;

import me.goldze.mvvmhabit.base.BaseApplication;

public class DbHelper extends SQLiteOpenHelper {
    private static DbHelper helper;
    public static int DB_VERSION = 1;

    public DbHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }


    public static synchronized DbHelper getInstance() {
        if (helper == null) {
            helper = new DbHelper(BaseApplication.getInstance(), "location.db", null, DB_VERSION);
        }
        return helper;
    }
}
